/*
 * Copyright 2022-2029 heshuixing(https://gitee.com/heshuixing)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.mercury.ec.module.air.controller.admin.search.vo.price;

import com.mercury.ec.module.air.controller.admin.search.validator.AirSearchPriceSequenceProvider;
import com.mercury.ec.module.air.validator.AirGroup;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.group.GroupSequenceProvider;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;

import static com.mercury.ec.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;

/**
 * 运价查询 Request VO
 *
 * @author hesx
 */
@Data
@Schema(description = "管理后台 - 运价查询 Request VO")
@GroupSequenceProvider(value = AirSearchPriceSequenceProvider.class)
public class AirSearchPriceReqVO {

    @Schema(description = "渠道编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "102")
    @NotNull(message = "渠道编号不能为空")
    private Long channelId;

    @Schema(description = "出发地三字码", requiredMode = Schema.RequiredMode.REQUIRED, example = "CAN")
    @NotBlank(message = "出发地不能为空")
    private String depart;

    @Schema(description = "目的地三字码", requiredMode = Schema.RequiredMode.REQUIRED, example = "CAN")
    @NotBlank(message = "目的地不能为空")
    private String arrive;

    @Schema(description = "航司代码", requiredMode = Schema.RequiredMode.REQUIRED, example = "CA")
    @NotBlank(message = "航司代码不能为空")
    private String airlineNo;

    @Schema(description = "航班号", requiredMode = Schema.RequiredMode.REQUIRED, example = "123")
    @NotBlank(message = "航班号不能为空")
    private String flightNo;

    @Schema(description = "出发日期", requiredMode = Schema.RequiredMode.REQUIRED, example = "2022-02-02")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    @NotNull(message = "出发日期不能为空")
    private LocalDate flightDate;

    @Schema(description = "客户协议类型 字典（air_customer_agreement_type 1-普通/2-GP/3-三方协议）", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "客户协议类型不能为空")
    private Integer customerAgreementType;

    @Schema(description = "客户协议号（三方协议必填）", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456")
    @NotBlank(message = "客户协议号不能为空", groups = {AirGroup.CustomerAgreement.class})
    private String customerAgreementNo;
}
